function showError(elemId, description) {
	document.getElementById(elemId).style.color = 'red';
	document.getElementById(elemId).style.fontSize = '9px';
	document.getElementById(elemId).innerHTML = description;
}

function hideError(elemId) {
	document.getElementById(elemId).innerHTML = "";
}

function alphabet(elemId) {
	var expression = /^[a-zA-Z]+(-[a-zA-Z]+)*$/;	
	if(document.getElementById(elemId).value.match(expression))
		return true;
	else
		return false;
}

function email(elemId) {
	var expression = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;	
	if(document.getElementById(elemId).value.match(expression))
		return true;
	else
		return false;
}

function isAlphabet(elemId, description) {
	if (alphabet(elemId))
		hideError(elemId+'Info');
	else
		showError(elemId+'Info', description);
}

function matchEmail(elemId, description) {
	if (email(elemId)) {
		hideError(elemId+'Info');
		document.getElementById('registerForm:send').disabled = false;
	} else {
		showError(elemId+'Info', description);
		document.getElementById('registerForm:send').disabled = true;
	}
}